package com.heima.user.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.user.dto.UserRelationDto;
import com.heima.user.service.IApUserFollowService;
import com.heima.user.service.IApUserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * APP用户信息表 前端控制器
 * </p>
 *
 * @author itheima
 * @since 2022-07-28
 */
@RestController
@RequestMapping("/api/v1/user")
@Api(tags = "APP用户信息表接口")
@CrossOrigin
public class ApUserController {

    @Autowired
    private IApUserService apUserService;
    @Autowired
    private IApUserFollowService apUserFollowService;

    /**
     * 关注和取消关注
     *
     * @param dto
     * @return
     */
    @PostMapping("user_follow")
    public ResponseResult follow(@RequestBody UserRelationDto dto) {
        return apUserFollowService.follow(dto);
    }

}
